package com.ruoyi.framework.es.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "product",type = "doc",useServerConfiguration = true,createIndex = false)
public class Product {
    @Id
    @Field(type =FieldType.Keyword)
    private Long productId;

    @Field(type = FieldType.Keyword)
    private String productCode;
    @Field(type = FieldType.Keyword)
    private String brand;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer="ik_smart")
    private String productName;
    @Field(type = FieldType.Double)
    private Double price;

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }
}
